package com.example.week02;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

import com.example.week02.day1.day1;
import com.example.week02.day2.day2;
import com.example.week02.day3.day3;
import com.example.week02.day4.day4;
import com.example.week02.day5.day5;

public class MainActivity extends AppCompatActivity {

    Button day1,day2,day3,day4,day5;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        EdgeToEdge.enable(this);
        setContentView(R.layout.activity_main);
        ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
            Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
            v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
            return insets;
        });

        day1 = findViewById(R.id.day1);
        day2 = findViewById(R.id.day2);
        day3 = findViewById(R.id.day3);
        day4 = findViewById(R.id.day4);
        day5 = findViewById(R.id.day5);

        day1.setOnClickListener(view -> {
            Intent intent = new Intent(MainActivity.this, day1.class);
            startActivity(intent);
        });

        day2.setOnClickListener(view -> {
            Intent intent = new Intent(MainActivity.this, day2.class);
            startActivity(intent);
        });

        day3.setOnClickListener(view -> {
            Intent intent = new Intent(MainActivity.this, day3.class);
            startActivity(intent);
        });

        day4.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(MainActivity.this, day4.class);
                startActivity(intent);
            }
        });

        day5.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(MainActivity.this, day5.class);
                startActivity(intent);
            }
        });
    }
}